package com.kfc.order.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kfc.order.dao.CustomerDao;
import com.kfc.order.service.CustomerManager;
import com.kfc.order.vo.Address;
import com.kfc.order.vo.Customer;
import com.kfc.order.vo.Log;
import com.kfc.order.vo.OrderForm;

@Service("cm")
public class CustomerManagerImpl implements CustomerManager {
	@Autowired(required = true)
	private CustomerDao cd;

	@Override
	public Customer login(String customertel, String customerpsd) {
		// TODO Auto-generated method stub
		return cd.findCustomer(customertel,customerpsd);
	}

	@Override
	@Transactional
	public int regist(Customer customer) {
		// TODO Auto-generated method stub
		return cd.addCustomer(customer);
	}

	@Override
	public boolean isExist(String tel) {
		// TODO Auto-generated method stub
		return cd.findTel(tel);
	}

	@Override
	@Transactional
	public int addAddress(Address address) {
		// TODO Auto-generated method stub
		return cd.addAddress(address);
	}



	@Override
	public int addLog(Log log) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int addOrderForm(OrderForm orderForm) {
		// TODO Auto-generated method stub
		return 0;
	}

}
